#!/usr/bin/perl -w

BEGIN {
	if(!exists($::ENV{LINUXHA_LIBS})) {
		$::ENV{LINUXHA_LIBS}="/opt/linuxha14/lib/perl";
	}
	push @INC,$::ENV{LINUXHA_LIBS};
}

use clnet qw(_gen_ip_list);
use Data::Dumper;

if(!defined($ARGV[1])) {
	print STDERR "Usage: show_ip_map addrs defnetmask\n";
	exit(1);
}

($ip,$netm)=_gen_ip_list($ARGV[0]);

for (split(/,/,$ip)) {
	if(exists($netm->{$_})) {
		printf("%-20s %s\n",$_,$netm->{$_});
	} else {
		printf("%-20s %s\n",$_,$ARGV[1]);
	}
}

